package td;

import java.io.File;
import java.io.IOException;
import java.util.Scanner;

/* Gets two files from command line, and compares them line/line.
 * Used to compare test output and expected output. */
public class OutputCompare {

	public static void main(String[] args) throws IOException {
		Scanner scan1 = new Scanner(new File(args[0]));
		Scanner scan2 = new Scanner(new File(args[1]));
		int i = 1;

		while (scan1.hasNext() && scan2.hasNext()) {
			String lin1, lin2;
			lin1 = scan1.nextLine();
			lin2 = scan2.nextLine();

			if (!lin1.equals(lin2)) {
				System.out.println("The files don't match. First difference in line: "+i);
			}
			i++;
		}
		System.out.println("The files contain the same output.");
	}

}
